package net.jlibrary.invoice.action.vo;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import net.jlibrary.common.CoreConstants;
import net.jlibrary.common.core.annotation.VoForPo;
import net.jlibrary.common.core.entity.BaseVo;
import net.jlibrary.common.project.domain.Group;
import net.jlibrary.invoice.domain.ElectronicInvoice;

@VoForPo(ElectronicInvoice.class)
public class ElectronicInvoiceActionVo extends BaseVo {
	private static final long serialVersionUID = -4674752496239100862L;
	private Long id;
	private GroupVo group;// 开票企业
	private String bankName;// 开户行名称
	private String bankAccount;// 开户行账号
	private String nsrsbh;// 纳税人识别号
	private String address;// 公司详细地址
	private String phone;// 联系电话
	private String biller;// 开票人
	private String email;// 邮箱
	private String payee;// 收款人
	private String reviewer;// 复核人
	private String shortName;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date createdate;

	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date lastdate;

	public ElectronicInvoiceActionVo() {
		group = new GroupVo();
	}

	public GroupVo getGroup() {
		return group;
	}

	public void setGroup(GroupVo group) {
		this.group = group;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getShortName() {
		return shortName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	public String getNsrsbh() {
		return nsrsbh;
	}

	public void setNsrsbh(String nsrsbh) {
		this.nsrsbh = nsrsbh;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getBiller() {
		return biller;
	}

	public void setBiller(String biller) {
		this.biller = biller;
	}

	public String getPayee() {
		return payee;
	}

	public void setPayee(String payee) {
		this.payee = payee;
	}

	public String getReviewer() {
		return reviewer;
	}

	public void setReviewer(String reviewer) {
		this.reviewer = reviewer;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Date getLastdate() {
		return lastdate;
	}

	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}

	@Override
	public Serializable getPrimaryKey() {
		return id;
	}

	@Override
	public Serializable getText() {
		return group.getFullName();
	}

	@VoForPo(Group.class)
	public class GroupVo extends BaseVo {
		private static final long serialVersionUID = -8541489466203273017L;
		private Long id;
		private String code;
		private String globalPath;
		private String fullName;
		private String shortName;
		private boolean valid;
		private boolean allowQueryInvalid;
		private boolean compellingDelete;
		private String loginMode;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		@Override
		public Serializable getPrimaryKey() {
			return id;
		}

		@Override
		public Serializable getText() {
			return shortName;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getGlobalPath() {
			return globalPath;
		}

		public void setGlobalPath(String globalPath) {
			this.globalPath = globalPath;
		}

		public String getFullName() {
			return fullName;
		}

		public void setFullName(String fullName) {
			this.fullName = fullName;
		}

		public String getShortName() {
			return shortName;
		}

		public void setShortName(String shortName) {
			this.shortName = shortName;
		}

		public boolean getValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public boolean getAllowQueryInvalid() {
			return allowQueryInvalid;
		}

		public void setAllowQueryInvalid(boolean allowQueryInvalid) {
			this.allowQueryInvalid = allowQueryInvalid;
		}

		public boolean getCompellingDelete() {
			return compellingDelete;
		}

		public void setCompellingDelete(boolean compellingDelete) {
			this.compellingDelete = compellingDelete;
		}

		public String getLoginMode() {
			return loginMode;
		}

		public void setLoginMode(String loginMode) {
			this.loginMode = loginMode;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}
	}

}
